﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ZDBase
{
    public partial class ColumnAddControl : UserControl
    {
        public ColumnAddControl()
        {
            InitializeComponent();
        }

        private void ColumnAddControl_Load(object sender, EventArgs e)
        {
            TypeColumn.Items.AddRange(Enum.GetNames(typeof(TypeCode)));
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (NameColumn.Text!="" && maskedTextBox1.Text!="" && TypeColumn.Text!="")
            {
                 ((Form)Parent).DialogResult= DialogResult.OK;
            }
            else
            {
                MessageBox.Show("Не заполнены поля");
            }
          
        }

        private void button2_Click(object sender, EventArgs e)
        {
            ((Form)Parent).DialogResult = DialogResult.Cancel;
        }
    }
}
